using UnityEngine;
using UnityEngine.UI;

public class OpenDir : MonoBehaviour
{
    void Start()
    {
        Button btn_json = transform.Find("btn_json").GetComponent<Button>();
        Button btn_excel = transform.Find("btn_excel").GetComponent<Button>();
        Button btn_script = transform.Find("btn_script").GetComponent<Button>();

        btn_json.onClick.AddListener(OnOpenJsonDir);
        btn_excel.onClick.AddListener(OnOpenExcelDir);
        btn_script.onClick.AddListener(OnOpenScriptDir);
    }

    /// <summary>
    /// 打开Json目录
    /// </summary>
    private void OnOpenJsonDir()
    {
        ExcelTool.GetInstance().json_path.OpenDir();
    }

    /// <summary>
    /// 打开Excel目录
    /// </summary>
    private void OnOpenExcelDir()
    {
        ExcelTool.GetInstance().excel_path.OpenDir();
    }

    /// <summary>
    /// 打开代码目录
    /// </summary>
    private void OnOpenScriptDir()
    {
        ExcelTool.GetInstance().script_path.OpenDir();
    }
}
